<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
	</head>
	<body>
		<div id="app">
		<!-- 属性说明: 
		1.number 将用户输入变为数值类型
		2.trim   去掉开头和结尾的空格
		3.lazy   懒加载 当鼠标离焦时生效
		-->
			<input name="age" v-model.number="age"/>
			<button @click="add">增加10</button><br />
			<input name="name" v-model.trim="name"/>
			获取name属性的长度{{name.length}}<br/>
			<input name="username" v-model.lazy="username"/><br/>
			username:{{username}}
		</div>
		<script src="https://cdn.jsdelivr.net/npm/vue@2"></script>
		<script>
			const app = new Vue({
				el: "#app",
				data: {
					age: '',
					name: '',
					username: ''
				},
				methods: {
					add(){
						this.age = 10 + this.age
					}
				}
			})
		</script>
	</body>
</html>
